#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.common.validator;

import java.util.regex.Pattern;


public class RegexValidator {

    private static final Pattern emailPattern = Pattern.compile("^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(${symbol_escape}${symbol_escape}.[a-zA-Z0-9_-]+)+${symbol_dollar}");

    private static final Pattern mobilePattern = Pattern.compile("^1[34578]${symbol_escape}${symbol_escape}d{9}${symbol_dollar}");

    public static boolean isEmail(String mail){
        if(mail == null){
            return false;
        }
        return emailPattern.matcher(mail).find();
    }

    public static boolean isMobile(String mobile){
        if(mobile == null){
            return false;
        }
        return mobilePattern.matcher(mobile).find();
    }


}
